Optimal. Leaf size=55 \[ \frac {x}{a}-\frac {(15-8 \csc (x)) \tan (x)}{15 a}+\frac {(5-4 \csc (x)) \tan ^3(x)}{15 a}-\frac {(1-\csc (x)) \tan ^5(x)}{5 a} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3973, 3967, 8}
\begin {gather*} \frac {x}{a}-\frac {\tan ^5(x) (1-\csc (x))}{5 a}+\frac {\tan ^3(x) (5-4 \csc (x))}{15 a}-\frac {\tan (x) (15-8 \csc (x))}{15 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3967
Rule 3973
Rubi steps
\begin {align*} \int \frac {\tan ^4(x)}{a+a \csc (x)} \, dx &=\frac {\int (-a+a \csc (x)) \tan ^6(x) \, dx}{a^2}\\ &=-\frac {(1-\csc (x)) \tan ^5(x)}{5 a}+\frac {\int (5 a-4 a \csc (x)) \tan ^4(x) \, dx}{5 a^2}\\ &=\frac {(5-4 \csc (x)) \tan ^3(x)}{15 a}-\frac {(1-\csc (x)) \tan ^5(x)}{5 a}+\frac {\int (-15 a+8 a \csc (x)) \tan ^2(x) \, dx}{15 a^2}\\ &=-\frac {(15-8 \csc (x)) \tan (x)}{15 a}+\frac {(5-4 \csc (x)) \tan ^3(x)}{15 a}-\frac {(1-\csc (x)) \tan ^5(x)}{5 a}+\frac {\int 15 a \, dx}{15 a^2}\\ &=\frac {x}{a}-\frac {(15-8 \csc (x)) \tan (x)}{15 a}+\frac {(5-4 \csc (x)) \tan ^3(x)}{15 a}-\frac {(1-\csc (x)) \tan ^5(x)}{5 a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(111\) vs. \(2(55)=110\).
time = 0.16, size = 111, normalized size = 2.02 \begin {gather*} \frac {200+6 (-89+120 x) \cos (x)+128 \cos (2 x)-178 \cos (3 x)+240 x \cos (3 x)+184 \cos (4 x)-64 \sin (x)-178 \sin (2 x)+240 x \sin (2 x)-128 \sin (3 x)-89 \sin (4 x)+120 x \sin (4 x)}{960 a \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )^3 \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )^5} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.11, size = 84, normalized size = 1.53
method | result | size |
default | \(\frac {-\frac {1}{6 \left (\tan \left (\frac {x}{2}\right )-1\right )^{3}}-\frac {1}{4 \left (\tan \left (\frac {x}{2}\right )-1\right )^{2}}+\frac {5}{8 \left (\tan \left (\frac {x}{2}\right )-1\right )}+2 \arctan \left (\tan \left (\frac {x}{2}\right )\right )+\frac {2}{5 \left (\tan \left (\frac {x}{2}\right )+1\right )^{5}}-\frac {1}{\left (\tan \left (\frac {x}{2}\right )+1\right )^{4}}+\frac {1}{\left (\tan \left (\frac {x}{2}\right )+1\right )^{2}}+\frac {11}{8 \left (\tan \left (\frac {x}{2}\right )+1\right )}}{a}\) | \(84\) |
risch | \(\frac {x}{a}+\frac {\frac {62 i {\mathrm e}^{2 i x}}{15}+\frac {146 \,{\mathrm e}^{3 i x}}{15}+\frac {62 \,{\mathrm e}^{i x}}{15}+\frac {10 i {\mathrm e}^{4 i x}}{3}+\frac {26 \,{\mathrm e}^{5 i x}}{3}+\frac {46 i}{15}-2 i {\mathrm e}^{6 i x}+2 \,{\mathrm e}^{7 i x}}{\left (i+{\mathrm e}^{i x}\right )^{5} \left ({\mathrm e}^{i x}-i\right )^{3} a}\) | \(87\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 194 vs.
\(2 (47) = 94\).
time = 0.47, size = 194, normalized size = 3.53 \begin {gather*} \frac {2 \, {\left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {46 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - \frac {13 \, \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} + \frac {100 \, \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} + \frac {35 \, \sin \left (x\right )^{5}}{{\left (\cos \left (x\right ) + 1\right )}^{5}} - \frac {30 \, \sin \left (x\right )^{6}}{{\left (\cos \left (x\right ) + 1\right )}^{6}} - \frac {15 \, \sin \left (x\right )^{7}}{{\left (\cos \left (x\right ) + 1\right )}^{7}} + 8\right )}}{15 \, {\left (a + \frac {2 \, a \sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {2 \, a \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - \frac {6 \, a \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} + \frac {6 \, a \sin \left (x\right )^{5}}{{\left (\cos \left (x\right ) + 1\right )}^{5}} + \frac {2 \, a \sin \left (x\right )^{6}}{{\left (\cos \left (x\right ) + 1\right )}^{6}} - \frac {2 \, a \sin \left (x\right )^{7}}{{\left (\cos \left (x\right ) + 1\right )}^{7}} - \frac {a \sin \left (x\right )^{8}}{{\left (\cos \left (x\right ) + 1\right )}^{8}}\right )}} + \frac {2 \, \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 4.13, size = 58, normalized size = 1.05 \begin {gather*} \frac {15 \, x \cos \left (x\right )^{3} + 23 \, \cos \left (x\right )^{4} - 19 \, \cos \left (x\right )^{2} + {\left (15 \, x \cos \left (x\right )^{3} - 8 \, \cos \left (x\right )^{2} + 1\right )} \sin \left (x\right ) + 4}{15 \, {\left (a \cos \left (x\right )^{3} \sin \left (x\right ) + a \cos \left (x\right )^{3}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\tan ^{4}{\left (x \right )}}{\csc {\left (x \right )} + 1}\, dx}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.43, size = 80, normalized size = 1.45 \begin {gather*} \frac {x}{a} + \frac {15 \, \tan \left (\frac {1}{2} \, x\right )^{2} - 36 \, \tan \left (\frac {1}{2} \, x\right ) + 17}{24 \, a {\left (\tan \left (\frac {1}{2} \, x\right ) - 1\right )}^{3}} + \frac {55 \, \tan \left (\frac {1}{2} \, x\right )^{4} + 260 \, \tan \left (\frac {1}{2} \, x\right )^{3} + 450 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 300 \, \tan \left (\frac {1}{2} \, x\right ) + 71}{40 \, a {\left (\tan \left (\frac {1}{2} \, x\right ) + 1\right )}^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.48, size = 83, normalized size = 1.51 \begin {gather*} \frac {x}{a}-\frac {-2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^7-4\,{\mathrm {tan}\left (\frac {x}{2}\right )}^6+\frac {14\,{\mathrm {tan}\left (\frac {x}{2}\right )}^5}{3}+\frac {40\,{\mathrm {tan}\left (\frac {x}{2}\right )}^4}{3}-\frac {26\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3}{15}-\frac {92\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{15}+\frac {2\,\mathrm {tan}\left (\frac {x}{2}\right )}{15}+\frac {16}{15}}{a\,{\left (\mathrm {tan}\left (\frac {x}{2}\right )-1\right )}^3\,{\left (\mathrm {tan}\left (\frac {x}{2}\right )+1\right )}^5} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________